<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/inc/taglib.jsp"%>
<div class="pageHeader">
	<form id="pagerForm" onsubmit="return navTabSearch(this);" action="${pageContext.request.contextPath}/memberManagement/member/list" method="post">
		<!-- 分页表单参数 -->
		<%@include file="/WEB-INF/page/inc/pageForm.jsp"%>

		<!-- 需要排序的字段 -->
		<input type="hidden" name="orderField" value="${requestScope.dwzPageBean.countResultMap.orderField}" />
		<!-- 正序倒序 -->
		<input type="hidden" name="orderDirection" value="${requestScope.dwzPageBean.countResultMap.orderDirection}" />

		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>会员名称： <input size="30" placeholder="请输入会员名称" name="org2.memberName" type="text" postField="memberName" suggestFields="memberName" suggestUrl="${pageContext.request.contextPath}/memberManagement/member/getMemberName" lookupGroup="org2"
						value="${requestScope.dwzPageBean.countResultMap.memberName}" />
					</td>
					<%-- <td>店铺名称：<input type="text" name="shopname" value="${requestScope.dwzPageBean.countResultMap.shopname}" placeholder="输入店铺名称" /></td> --%>
					<td>店铺名称： <input size="30" placeholder="请输入店铺名称" name="org2.shopName" type="text" postField="shopName" suggestFields="shopName" suggestUrl="${pageContext.request.contextPath}/memberManagement/member/getShopName" lookupGroup="org2" value="${requestScope.dwzPageBean.countResultMap.shopName}" />
					</td>
					<td><label style="width: 35px;">性别：</label> <select name="memberSex" class="combox">
							<option value="" selected="selected">请选择</option>
							<option value="0" ${requestScope.dwzPageBean.countResultMap.memberSex == 0 ? 'selected':''}>女</option>
							<option value="1" ${requestScope.dwzPageBean.countResultMap.memberSex == 1 ? 'selected':''}>男</option>
					</select></td>
					<td><label style="width: 60px;">会员状态：</label> <select name="memberState" class="combox">
							<option value="" selected="selected">请选择</option>
							<option value="0" ${requestScope.dwzPageBean.countResultMap.memberState == 0 ? 'selected':''}>启用</option>
							<option value="1" ${requestScope.dwzPageBean.countResultMap.memberState == 1 ? 'selected':''}>停用</option>
					</select></td>
				</tr>
			</table>
			<div class="subBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">查询</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<shiro:hasPermission name="/memberManagement/member/export">
				<li><a href="${pageContext.request.contextPath}/memberManagement/member/export" target="dwzExport" targetType="navTab" title="确定要导出这些记录吗?" class="icon"><span>导出EXCEL</span></a></li>
			</shiro:hasPermission>
		</ul>
	</div>
	<table class="table" targetType="navTab" asc="asc" desc="desc" width="100%" layoutH="138">
		<thead>
			<tr>
				<th orderField="member_name" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'member_name'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>会员姓名</th>
				<th orderField="member_num" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'member_num'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>会员号</th>
				<th orderField="member_phone" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'member_phone'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>会员电话</th>
				<th orderField="type_name" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'type_name'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>会员等级</th>
				<th orderField="add_time" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'add_time'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>入会时间</th>
				
				<th orderField="shopname" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'shopname'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>店铺名称</th>
				<th orderField="referencename" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'referencename'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>推荐人</th>
				<th orderField="member_sex" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'member_sex'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>性别</th>
				<th orderField="member_birthday" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'member_birthday'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>出生日期</th>
				<th orderField="member_state" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'member_state'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>会员状态</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<c:if test="${requestScope.dwzPageBean != null &&  requestScope.dwzPageBean.recordList != null }">
				<c:forEach var="record" items="${requestScope.dwzPageBean.recordList}" varStatus="status">
					<tr ondblclick="openDetails(this)" target="navTab" href="${pageContext.request.contextPath}/memberManagement/member/cardRechargeList?id=${record.memberId}" title="充值记录">
						<td>${record.memberName}</td>
						<td>${record.memberNum}</td>
						<td>${record.memberPhone}</td>
						<td>${record.typeName}</td>
						<td><fmt:formatDate pattern="yyyy-MM-dd" value="${record.addTime}" /></td>
						<td>${record.shopname}</td>
						<td>${record.referencename}</td>
						<td>${record.memberSex == 0 ? '女':'男'}</td>
						<td><fmt:formatDate pattern="yyyy-MM-dd" value="${record.memberBirthday}" /></td>
						<td>${record.memberState == 0 ? '启用':'停用'}</td>
						<td>
							<shiro:hasPermission name="/memberManagement/member/cardRechargeList">
								<a title="充值记录" target="navTab" rel="${pageContext.request.contextPath}/memberManagement/member/cardRechargeList" href="${pageContext.request.contextPath}/memberManagement/member/cardRechargeList?id=${record.memberId}" class="detailsBtn"><span style="margin-right: 10px">充值记录</span></a>
							</shiro:hasPermission>
							<shiro:hasPermission name="/memberManagement/member/orderList">
								<a title="购买记录" target="navTab" rel="${pageContext.request.contextPath}/memberManagement/member/orderList" href="${pageContext.request.contextPath}/memberManagement/member/orderList?id=${record.memberId}" class="detailsBtn"><span style="margin-right: 10px">购买记录</span></a>
							</shiro:hasPermission>
						</td>
					</tr>
				</c:forEach>
			</c:if>
		</tbody>
	</table>
	<!-- 分页条 -->
	<%@include file="/WEB-INF/page/inc/pageBar.jsp"%>
</div>